package com.chapter11.homework_.homework01;

/**
 * @author 宋鑫宇
 * @version 1.0
 */
public class HomeWork01 {
    public static void main(String[] args) {
        Color black = Color.BLACK;
        black.show();
        switch (black) {
            case RED:
                System.out.println("红色");
                break;
            case BLUE:
                System.out.println("蓝色");
                break;
            case BLACK:
                System.out.println("黑色");
                break;
        }

    }
}
enum Color implements A {
    RED(255, 0, 0), BLUE(0, 0, 255),
    BLACK(0, 0, 0), YELLOW(255, 255, 0),
    GREEN(0, 255, 0);
    private int redValue;
    private int greenValue;
    private int blueValue;

    Color(int redValue, int greenValue, int blueValue) {
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }

    @Override
    public void show() {
        System.out.println(redValue+" "+greenValue+" "+blueValue);
    }
}
interface A{
    public void show();
}

